<h2>名人机构 &gt; 搜索</h2>

<form action='<?= AdminController::_makeURL('friends', 'star', 'index')?>' method="POST" >
<table class='property' cellpadding="0" cellspacing="0">
	<tr>
		<td class='key'>用户id</td>
		<td><input type='text' name='uid' value="<?=$this->uid?>"/></td>
	</tr>
	<tr>
		<td class='key'>用户名</td>
		<td><input type='text' name='username' value=''/></td>
	</tr>
	
</table>
<input type='submit' value=' 搜索用户 ' name="search"/>
</form>

<br /><br />
<form action='<?= AdminController::_makeURL('friends', 'star', 'index')?>' method="POST" >
<?if ($this->userInfo):?>
<table class='property' cellpadding="0" cellspacing="0">
	<tr>
		<td class='key'>用户类别:</td>
		<td><input type="radio" name="user[type]" value="1" style="width:15px;">名人 <input type="radio" name="user[type]" value="2" checked style="width:20px;">机构 </td>
	</tr>
	<tr>
		<td class='key'>选择分类:</td>
		<td>
		<select name="user[cate]">
			<option value="0"> 一级分类 </option>
			<?php foreach($this->ret as $key => $val):?>
				<option value="<?if ($val['dep'] == 1) {echo $val['parent_id'] . '_' . $val['id'];} else{echo $val['id'];}?>" rel="<?=$val['dep']?>"><?=str_repeat(' │ ', $val['dep']) . '├─' . $val['cate_name']?></option>
			<?php endforeach;?>
			</select>
		</td>
	</tr>
	
	<tr>
		<td class='key'>父级用户ID:</td>
		<td><input type="text" name="user[parent_uid]" value="0"></td>
	</tr>

	<tr>
		<td class='key'>用户ID:</td>
		<td><input type="text" name="user[uid]" readonly value="<?=$this->userInfo['id']?>"></td>
	</tr>
	<tr>
		<td class='key'>用户名:</td>
		<td><input type="text" name="user[name]" readonly value="<?=$this->userInfo['username']?>"></td>
	</tr>
	
</table>
<input type='submit' value=' 添加名人机构用户 ' name="add"/>
<?endif;?>
</form>


<br /><br />
<table class='property' cellpadding="0" cellspacing="0">
<tr>
	<td class='key'>用户ID:</td>
	<td class='key'>用户名称:</td>
	<td class='key'>用户类别:</td>
	<td class='key'>用户分类:</td>
	<td class='key'>用户父级UID:</td>
	<td class='key'>用户子级UID:</td>
</tr>

<?foreach ($this->allStars as $k => $v):?>
	<tr>
		<td><?=$v['id']?></td>
		<td><?=$v['username']?></td>
		<td><?if ($v['type']==1) echo '名人'; else echo '机构';?></td>
		<td><?=$v['cate_1_name']?> <?if ($v['cate_2_name']):?>-> <?=$v['cate_2_name']?><?endif;?></td>
		<td><?=$v['parent_uid']?></td>
		<td><?=implode(', ', (array)unserialize($v['childs']))?></td>
	</tr>
<?endforeach;?>
</table>